<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

use DB;

class Comcheckagaindetail extends Model
{
    //
    protected $table = 'comcheckagaindetail';
    public $timestamps = false;

    public function addAll(Array $data)
 	{
        $rs = DB::table($this->getTable())->insert($data);
        return $rs;
  	}

    public function getEntryByCheckAgainId($checkAgainId) 
    {
        $rs = DB::select("select checkentry.id as entryId,checkentry.entry,checkentry.proposal,detail.id as detailId,detail.pictures as pictures,detail.content as content,detail.negatives,detail.groupId,detail.checkDetailId from comcheckagaindetail detail 
                        left join checkentry 
                        on checkentry.id = detail.entryId 
                        where detail.checkId = $checkAgainId and detail.status != 3 ");
        return $rs;
    }

}
